import daisy.lang._
import Real._


object InvertedPendulum4 {

  // all: <1, 32, 30> [-1, 1]
  def out1() = {
    require(-1 <= s1 && s1 <= 1 && -1 <= s2 && s2 <= 1 && -1 <= s3 && s3 <= 1 && -1 <= s4 && s4 <= 1)
    (1.536200) * s1 + (2.025400) * s2 + (-16.519200) * s3 + (-2.735800) * s4
  }

  def state1() = {
    require(-1 <= s1 && s1 <= 1 && -1 <= s2 && s2 <= 1 && -1 <= s3 && s3 <= 1 && -1 <= s4 && s4 <= 1 &&
      -1 <= y1 && y1 <= 1 && -1 <= y2 && y2 <= 1)
    (0.998301) * s1 + (0.001002) * s2 + (-0.000114) * s3 + (-0.000002) * s4 + (0.001700) * y1 + (0.000100) * y2
  }

  def state2() = {
    require(-1 <= s1 && s1 <= 1 && -1 <= s2 && s2 <= 1 && -1 <= s3 && s3 <= 1 && -1 <= s4 && s4 <= 1 &&
      -1 <= y1 && y1 <= 1 && -1 <= y2 && y2 <= 1)
    (0.000693) * s1 + (1.003500) * s2 + (-0.029160) * s3 + (-0.004972) * s4 + (0.002100) * y1 + (0.001800) * y2
  }

  def state3() = {
    require(-1 <= s1 && s1 <= 1 && -1 <= s2 && s2 <= 1 && -1 <= s3 && s3 <= 1 && -1 <= s4 && s4 <= 1 &&
      -1 <= y1 && y1 <= 1 && -1 <= y2 && y2 <= 1)
    (-0.001197) * s1 + (0.000004) * s2 + (0.987778) * s3 + (0.000994) * s4 + (0.001200) * y1 + (0.012200) * y2
  }

  def state4() = {
    require(-1 <= s1 && s1 <= 1 && -1 <= s2 && s2 <= 1 && -1 <= s3 && s3 <= 1 && -1 <= s4 && s4 <= 1 &&
      -1 <= y1 && y1 <= 1 && -1 <= y2 && y2 <= 1)
    (0.006982) * s1 + (0.008751) * s2 + (-0.120899) * s3 + (0.987581) * s4 + (0.000000) * y1 + (0.077000) * y2
  }



}